version: '3.9'
services:
 flask1:
  container_name: flask1
  build: .
  image: flask
  restart: unless-stopped
  networks:
   internal:
    ipv4_address: 172.16.8.2
 flask2:
  container_name: flask2
  image: flask
  restart: unless-stopped
  networks:
   internal:
    ipv4_address: 172.16.8.3
 web:
  image: nginx
  ports:
   - 5000:5000
  volumes:
   - ./nginx.conf:/etc/nginx/nginx.conf
   - ./flask.key:/etc/nginx/flask.key
   - ./flask.crt:/etc/nginx/flask.crt
  networks:
   internal:
    ipv4_address: 172.16.8.10
   external:
    ipv4_address: 172.20.10.2

networks:
 internal:
  ipam:
   driver: default
   config:
    - subnet: 172.16.8.0/28
      gateway: 172.16.8.1
  internal: true
 external:
  ipam:
   config:
    - subnet: 172.20.10.0/28


